﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/MasterAdmin.master" AutoEventWireup="true" CodeFile="OrderByDate.aspx.cs" Inherits="Admin_OrderByDate" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
             <h1>Orders By DateTime</h1>
    
    <table style="width:100%;">
        <tr>
            <td>
                From DateTime</td>
            <td>
                <asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" 
                    TargetControlID="txtFrom" Format="dd/MM/yyyy">
                </asp:CalendarExtender>
            </td>
            <td>
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ControlToValidate="txtFrom" ErrorMessage="Invalidate DateTime" ForeColor="Red" 
                    Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtFrom" ErrorMessage="Required" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
        </tr>
        <tr>
            <td>
                To DateTime</td>
            <td>
                <asp:TextBox ID="txtTo" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender2" runat="server"
                    TargetControlID="txtTo" Format="dd/MM/yyyy">
                </asp:CalendarExtender>
            </td>
            <td>
                <asp:CompareValidator ID="CompareValidator2" runat="server" 
                    ControlToValidate="txtTo" ErrorMessage="Invalidate DateTime" ForeColor="Red" 
                    Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtTo" ErrorMessage="Required" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:CompareValidator ID="CompareValidator3" runat="server" 
                    ControlToCompare="txtFrom" ControlToValidate="txtTo" 
                    ErrorMessage="Must greater than From Datetime" ForeColor="Red" 
                    Operator="GreaterThanEqual" Type="Date"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="btnFilter" runat="server" Text="Filter" 
                    onclick="btnFilter_Click" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

<br />
<br />

    
    <asp:ListView ID="ListView1" runat="server" 
        onitemdatabound="ListView1_ItemDataBound" >
        <AlternatingItemTemplate>
            <tr style="background-color: #FFFFFF; color: #284775;">
                <td>
                    <asp:Label ID="oOrderCodeLabel" runat="server" 
                        Text='<%# Eval("oOrderCode") %>' />
                </td>
                <td>
                    <asp:Label ID="oUserLabel" runat="server" Text='<%# Eval("oUser") %>' />
                </td>
                <td>
                    <asp:Label ID="oDateLabel" runat="server" Text='<%# Eval("oDate") %>' />
                </td>
                <td>
                    <asp:Label ID="oTypePaymentLabel" runat="server" 
                        Text='<%# Eval("oTypePayment") %>' />
                </td>
                <td>
                    <asp:Label ID="oStatusLabel" runat="server" Text='<%# Eval("oStatus") %>' />
                </td>
            </tr>
        </AlternatingItemTemplate>
        
        <EmptyDataTemplate>
           <table id="Table1" runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                border-color: #999999; border-style: none; border-width: 1px;">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        
        <ItemTemplate>
            <tr style="background-color: #E0FFFF; color: #333333;">
                <td>
                    <asp:Label ID="oOrderCodeLabel" runat="server" 
                        Text='<%# Eval("oOrderCode") %>' />
                </td>
                <td>
                    <asp:Label ID="oUserLabel" runat="server" Text='<%# Eval("oUser") %>' />
                </td>
                <td>
                    <asp:Label ID="oDateLabel" runat="server" Text='<%# Eval("oDate") %>' />
                </td>
                <td>
                    <asp:Label ID="oTypePaymentLabel" runat="server" 
                        Text='<%# Eval("oTypePayment") %>' />
                </td>
                <td>
                    <asp:Label ID="oStatusLabel" runat="server" Text='<%# Eval("oStatus") %>' />
                    
                </td>
            </tr>
        </ItemTemplate>
        <LayoutTemplate>
            <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                       <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
                            border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
                            font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr id="Tr2" runat="server" style="background-color: #E0FFFF; color: #333333;">
                                <th id="Th1" runat="server">
                                     Order Code</th>
                                <th id="Th2" runat="server">
                                    User</th>
                                <th id="Th3" runat="server">
                                    Date Created</th>
                                <th id="Th4" runat="server">
                                     Type Payment</th>
                                <th id="Th5" runat="server">
                                    Order Status</th>
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif;
                        color: #FFFFFF">
                        <asp:DataPager ID="DataPager1" runat="server">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>

        </ContentTemplate>
    </asp:UpdatePanel>

       
</asp:Content>

